clear;close;clc;

n = 1000;
A = ones(n, n);
B = zeros(n, n);

display('iterator:');
tic
for k = 1: n
    for l = 1: n
        for m = 1: n
        B(k, l) = B(k, l) + A(k, m) * A(l, m);
        end
    end
end
toc

display('vector:');
tic
C = A * A;
toc